package com.ruoyi.student.service.impl;

import com.ruoyi.student.domain.SchoolDegreeInfo;
import com.ruoyi.student.domain.vo.DepartmentListVo;
import com.ruoyi.student.domain.vo.GradeListVo;
import com.ruoyi.student.domain.vo.MajorListVo;
import com.ruoyi.student.mapper.SchoolDegreeInfoMapper;
import com.ruoyi.student.service.ISchoolDegreeInfoService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * 年级系别专业Service业务层处理
 *
 * @author linyang
 * @date 2022-12-23
 */
@Service
public class SchoolGradeInfoServiceImpl implements ISchoolDegreeInfoService {
    @Resource
    private SchoolDegreeInfoMapper schoolGradeInfoMapper;

    /**
     * 查询年级系别专业
     *
     * @param id 年级系别专业主键
     * @return 年级系别专业
     */
    @Override
    public SchoolDegreeInfo selectSchoolGradeInfoById(Long id) {
        return schoolGradeInfoMapper.selectSchoolDegreeInfoById(id);
    }

    /**
     * 查询年级系别专业列表
     *
     * @param schoolGradeInfo 年级系别专业
     * @return 年级系别专业
     */
    @Override
    public List<SchoolDegreeInfo> selectSchoolGradeInfoList(SchoolDegreeInfo schoolGradeInfo) {
        return schoolGradeInfoMapper.selectSchoolDegreeInfoList(schoolGradeInfo);
    }

    /**
     * 新增年级系别专业
     *
     * @param schoolGradeInfo 年级系别专业
     * @return 结果
     */
    @Override
    public int insertSchoolGradeInfo(SchoolDegreeInfo schoolGradeInfo) {
        return schoolGradeInfoMapper.insertSchoolDegreeInfo(schoolGradeInfo);
    }

    /**
     * 修改年级系别专业
     *
     * @param schoolGradeInfo 年级系别专业
     * @return 结果
     */
    @Override
    public int updateSchoolGradeInfo(SchoolDegreeInfo schoolGradeInfo) {
        return schoolGradeInfoMapper.updateSchoolDegreeInfo(schoolGradeInfo);
    }

    /**
     * 批量删除年级系别专业
     *
     * @param ids 需要删除的年级系别专业主键
     * @return 结果
     */
    @Override
    public int deleteSchoolGradeInfoByIds(Long[] ids) {
        return schoolGradeInfoMapper.deleteSchoolDegreeInfoByIds(ids);
    }

    /**
     * 删除年级系别专业信息
     *
     * @param id 年级系别专业主键
     * @return 结果
     */
    @Override
    public int deleteSchoolGradeInfoById(Long id) {
        return schoolGradeInfoMapper.deleteSchoolDegreeInfoById(id);
    }


    /**
     * 获取SelectListVo形式的数据
     *
     * @return
     */
    public List<GradeListVo> selectList() {
        return schoolGradeInfoMapper.selectList();
    }


    /**
     * 删除所有数据
     */
    @Override
    public void deleteAll() {
        schoolGradeInfoMapper.deleteAll();
    }


    /**
     * 获取系别聚合列表
     *
     * @return
     */
    public List<DepartmentListVo> selectDepartmentGroup() {
        return schoolGradeInfoMapper.selectDepartmentGroup();
    }


    /**
     * 获取专业聚合李彪
     *
     * @return
     */
    public List<MajorListVo> selectMajorGroup() {
        return schoolGradeInfoMapper.selectMajorGroup();
    }




}
